(function(window){
	var Subject_lookintoCtrl = {
		data:{},
		init: function(data){
			this.bindEven();
			$("#tkjd").width($(".tk_home").width());
			var tkjd_w=$("#tkjd").width();
			var l=$(".tmitem").length;
			var w=tkjd_w/l;
			Subject_lookintoCtrl.data.tmitem_w=w;
			$(".tmitem").width(w);
			$(".tmitem:last").width(0);
			$(".tmitem").parent().css("padding-left",w/2+"px");
			$("#dqts").css("left",(w/2+4)+"px");
			
		 
        },
		post_answer:function(){
			var data_id=$(this).attr("data-id");
		    $("#questions_answer_"+data_id).show();
			$(".answer_remark").show();
			$(this).hide();	
			var answer="right";
			var datatid=42023;
			var _this=$('[datatid="'+datatid+'"]');
			var img=$("#tk_jd_bg_"+answer).clone();
			_this.find(".tk_jd_bg").html(img);
			_this.prev().find(".jiange").addClass("bar_"+answer);
			var tk_jd_bg_img=_this.find(".tk_jd_bg img");
			$(tk_jd_bg_img).css("display","inherit");
			$(tk_jd_bg_img).animate({top:"0px"});
			var index=$(".tmitem").index(_this);
			Subject_lookintoCtrl.animate_to(index);
			
		},
		tmitem:function(){
			var p=$(this).parent();
			var index=$(".tmitem a").index($(this));
			Subject_lookintoCtrl.animate_to(index);
		},
		animate_to:function(index){
			var tmitem_w=Subject_lookintoCtrl.data.tmitem_w;
			var left=tmitem_w*index+(tmitem_w/2+4);
			$("#dqts").animate({left:left+"px"});
		},
		bindEven: function(){
            var bindings = [{
                element:'.sumbit_answer',
                event: hiApp.device.click,
                handler: this.post_answer
            },
			{
                element:'.tmitem a',
                event: hiApp.device.click,
                handler: this.tmitem
            }
			];
            bindEvents(bindings);
        },
		 
		
    };
		
	window.BoxEdu_Subject_lookintoCtrl = Subject_lookintoCtrl;
						
})(window);